<%--
  Created by IntelliJ IDEA.
  User: WHZ
  Date: 2024/11/2
  Time: 10:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <style>
        table {
            width: 800px !important;
            margin: 0 auto !important;
        }
        .layui-form-item{
            text-align: center;
        }
        .layui-form-item .layui-input-inline {
            float: none;
        }
    </style>
</head>
<body>
<p>
<form class="layui-form" method="post" action="/student/list/1">
    <div class="layui-form-item">
        <div class="layui-input-inline layui-input-wrap">
            <input type="text" name="sId" value="${student_info.s_id}" placeholder="请输入编号" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
        </div>
        <div class="layui-input-inline layui-input-wrap">
            <input type="text" name="studentnunm" value="${student_info.student_num}" placeholder="请输入学号" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
        </div>
        <div class="layui-input-inline layui-input-wrap">
            <input type="text" name="studentName" value="${student_info.student_name}" placeholder="请输入姓名" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
        </div>
        <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
        <a class="layui-btn" href="/student/toadd">新增用户</a>
    </div>
</form>
</p>
<table class="layui-table" lay-even>
    <colgroup>
        <col width="100">
        <col width="150">
        <col width="150">
        <col width="100">
        <col width="100">
        <col width="250">
        <col width="130">
        <col width="130">
        <col width="150">
        <col width="200">
        <col width="150">
        <col width="100">
        <col width="50">
        <col width="200">
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>出生日期</th>
        <th>班级编号</th>
        <th>宿舍编号</th>
        <th>联系电话</th>
        <th>电子邮件地址</th>
        <th>家庭地址</th>
        <th>紧急联系人姓名</th>
        <th>紧急联系人电话</th>
        <th>紧急联系人专业</th>
        <th>学生状态</th>
        <th>删除标志</th>
        <th>创建者</th>

        <th>备注</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${students}" var="student">
        <tr>
            <td>${student.sId}</td>
            <td>${student.studentNum}</td>
            <td>${student.studentName}</td>

            <td>
                <c:choose>
                    <c:when test="${student.gender == '0'}">男</c:when>
                    <c:when test="${student.gender == '1'}">女</c:when>
                    <c:otherwise>保密</c:otherwise>
                </c:choose>
            </td>
            <td>${student.age}</td>
            <td>
                <fmt:formatDate value="${student.birthday}" pattern="yyyy年MM月dd日" />
            </td>
            <td>${student.classId}</td>
            <td>${student.hostelId}</td>
            <td>${student.phone}</td>
            <td>${student.email}</td>
            <td>${student.homeAddress}</td>
            <td>${student.emergencyContact}</td>
            <td>${student.emergencyContactPhone}</td>
            <td>${student.major}</td>
            <td>
                <c:choose>
                    <c:when test="${student.status}">在读</c:when>
                    <c:otherwise>毕业</c:otherwise>
                </c:choose>
            </td>
            <td>
            ${student.delFlag}
            </td>
            <td>${student.createBy}</td>

            <td>${student.remark}</td>

            <td>
                <a href="/student/toupdate/${student.sId}">修改</a>
                <a href="/student/delete/${student.sId}">删除</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="4">
            <a href="/student/list/1">首页</a>
            <c:if test="${page.currentPage!=1}">
                <a href="/student/list/${page.currentPage-1}">上一页</a>
            </c:if>
            第${page.currentPage}页/共${page.totalPage}页
            <c:if test="${page.currentPage!=page.totalPage}">
                <a href="/student/list/${page.currentPage+1}">下一页</a>
            </c:if>
            <a href="/student/list/${page.totalPage}">尾页</a>
        </td>
    </tr>
    </tbody>
</table>
</body>
</html>
